import unittest

from Autotests.BaseTest import AirClientTestCase
from Autotests.LocalMachine.Pages.AirClient.OptionsPage.BandwidthTab import BandwidthTab


class OptionsBandwidthTest(AirClientTestCase):
    def test_AddBandwidth(self):
        testSettings = ('22:00', '23:00', '512', '1024')

        bandwidth = BandwidthTab()
        bandwidth.clearBandwidthSettings()
        bandwidth.setBandwidthSettings(*testSettings)
        self.assertEqual(bandwidth.getBandwidthSettings(), testSettings, "Bandwidth settings weren't set correctly")

    def test_clearBandwidth(self):
        cleanSettings = ('00:00', '00:00', '', '')

        bandwidth = BandwidthTab()
        bandwidth.clearBandwidthSettings()
        self.assertEqual(bandwidth.getBandwidthSettings(), cleanSettings, "Bandwidth settings weren't cleaned")

    def test_AddZeroBandwidth(self):
        testSettings = ('22:00', '23:00', '0', '0')

        bandwidth = BandwidthTab()
        bandwidth.clearBandwidthSettings()
        bandwidth.setBandwidthSettings(*testSettings)
        self.assertEqual(bandwidth.getBandwidthSettings(), testSettings, "Bandwidth settings weren't set correctly")

if __name__ == "__main__":
    unittest.main()